package
{
	import flash.display.Sprite;
	import flash.text.TextField;
	import flash.text.TextFieldAutoSize;
	
	

	public class ButtonDisplayState extends Sprite
	{
		private var _bgColor:uint;
		private var _width:uint;
		private var _height:uint;
		private var _text:String;
		
		
		public function ButtonDisplayState(bgColor:uint, width:uint=80,height:uint=20,text:String="button") {
			this._bgColor = bgColor;
			this._width    = width;
			this._height = height;	
			this._text = text;
			draw();
		}
		
		private function draw():void {
			graphics.beginFill(_bgColor);
			graphics.drawRoundRect(0, 0, _width, _height,10,10);
			graphics.endFill();	
			
			var tf:TextField = new TextField();
			tf.text = _text;
			tf.width = this.width;
			tf.height = this.height;
			tf.x = 0;
			tf.y = 0;
			tf.autoSize = TextFieldAutoSize.CENTER;
			addChild(tf);
			
		}
	}
}